#include "../header.h"


int main(int argc, char const *argv[])
{
    
    //1.获取pid优先级
    int pro = getpriority(PRIO_PROCESS,getpid()); 
    printf("pid:%d 优先级：%d\n",getpid(),pro);   

    //2.设定pid优先级
    //! sudo 可以提高优先级
    setpriority(PRIO_PROCESS,getpid(),-2);
    //3.再次获取优先级
    pro = getpriority(PRIO_PROCESS,getpid()); 
    printf("pid:%d 优先级：%d\n",getpid(),pro);   
    return 0;
}
